//
//  TestModel.m
//  第六章节的Demo
//
//  Created by clz on 2019/9/22.
//  Copyright © 2019 clz. All rights reserved.
//

#import "TestModel.h"

@implementation TestModel

- (NSString *)filterData:(id)data{
    if (data && ![data isKindOfClass:[NSNull class]]) {
        if ([data  isKindOfClass:[NSString class]]) {
            return data;
        }else if([data isKindOfClass:[NSNumber class]]){
            return ((NSNumber *)data).stringValue;
        }
    }
    return @"";
}


- (void)setValueWithData:(NSDictionary *)data{
    
    self.abbreviation = [self filterData:data[@"abbreviation"]];
    self.en = [self filterData:data[@"en"]];
    
    self.groupId = [self filterData:data[@"groupId"]];
    self.languageId = [self filterData:data[@"languageId"]];
    self.modified = [self filterData:data[@"modified"]];
    self.zh = [self filterData:data[@"zh"]];



    
}

@end
